﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using API.Cryptsy;
using API.Cryptsy.Entity;
using System.Collections.Specialized;

using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;

namespace Harness
{
    class Program
    {
        static void Main(string[] args)
        {
            Cryptsy api = new Cryptsy();
            api.PublicKey = "28c8f3a0c45a73005c81368f8a5e8da0c82dcf45";
            api.PrivateKey = "3275c31d44557f2ccd8669c34b31899878391a2c737f3e93a851b3488b432ff75d81c41c11e4d029";

            MarketOrders data = api.MarketOrders(135);

            Console.WriteLine("Done!");
            Console.Read();
        }

        static void test_methods(Cryptsy api)
        {
            //api.GetInfo();
            //api.GetMarkets();
            ////api.GetWalletStatus();
            //api.MyTransactions();
            //api.AllMyOrders();
            NameValueCollection c = api.GetMyDepositAddresses();
            //api.MyTransfers();
            //api.AllMyTrades();
            //DateTime startDate = DateTime.Now.Subtract(new TimeSpan(1, 0, 0)), endDate = DateTime.Now;
            //api.AllMyTrades(startDate, endDate);
            int marketid = 135;
            //api.MarketTrades(marketid);
            //api.MarketOrders(marketid);
            //api.MyTrades(marketid);

            //uint limit = 10;
            //api.MyTrades(marketid, limit);
            //api.MyOrders(marketid);
            //api.Depth(marketid);

            OrderType ordertype = OrderType.Sell;
            double quantity = 10;
            double price = 0.1;
            api.CalculateFees(ordertype, quantity, price);

            api.CancelMarketOrders(marketid);
            api.CreateOrder(marketid, ordertype, quantity, price);
            api.CancelAllOrders();

            //long orderid = (long)api.CreateOrder(marketid, ordertype, quantity, price);
            //api.CancelOrder(orderid);
            
            

            //int currencyid = 1;
            //string currencycode = "";
            //api.GenerateNewAddress(currencyid);
            //api.GenerateNewAddress(currencycode);

            //double amount = 0.00000001;
            //string address = "";
            //api.MakeWithdrawal(address, amount);
        }
    }
}
